﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Caching;
using System.Web;

namespace YYS
{
    public class CacheHelper
    {
        private static MemoryCache cache = MemoryCache.Default;

        public static void AddLogin(string key, string userName, DateTimeOffset expirationTime)
        {
            cache.Set(key, userName, expirationTime);
        }

        public static bool IsLoginValid(string key)
        {
            return cache.Contains(key);
        }
    }
}